#
# Application Makefile   
#

ifndef DEBUG
DEBUG = -g
endif

ifndef OPTIM
OPTIM = -Osax
endif

# REX libraries
A = ../../../lib
S = ../../../int
ALIB = $(A)/act.lib
RLIB = $(A)/rlib.lib 
SLIB = $(S)/slib.lib
TLIB = $(A)/tty.lib

REXLIBS = $(ALIB) $(RLIB) $(SLIB) $(TLIB)

PLATFORM=default
PHABOPTS=

CFLAGS  = -v$(PLATFORM) -3 -mf -w5 $(OPTIM) $(DEBUG) $(PHABOPTS)
CXXFLAGS = $(CFLAGS)
LDFLAGS = -T1 -v$(PLATFORM) -3 -mf $(DEBUG) -l Aplib -l phrtlib -l phexlib -l phcontrib -l photon   -l phrender_s $(PHABOPTS)
SDFLAGS = -T1 -v$(PLATFORM) -3 -mf $(DEBUG) -l Aplib -l phrtlib -l phexlib -l phcontrib -l photon_s -l phrender_s $(PHABOPTS)

VPATH = ../.

include	../abOfiles
include ../indOfiles

include	../abSfiles
include ../indSfiles

include	../abHfiles
include ../indHfiles

include	../abWfiles

#
# Application Program
#

shr:	$(ABOBJ) $(MYOBJ)
		$(LD) $(SDFLAGS) $(ABOBJ) $(MYOBJ) -l $(REXLIBS) -l socket -M -o toolBar
		usemsg toolBar ../Usemsg
		phabbind toolBar $(ABMOD)

app:	$(ABOBJ) $(MYOBJ)
		$(LD) $(LDFLAGS) $(ABOBJ) $(MYOBJ) -l $(REXLIBS) -l socket -M -o toolBar
		usemsg toolBar ../Usemsg
		phabbind toolBar $(ABMOD)

clean:
		rm -f *.o *.err *.map toolBar

install:
		-cp -vnf toolBar /usr/bin/photon

#
# Headers
#

$(ABOBJ) $(MYOBJ):	$(MYHDR)

#
# Prototype Generation
#

proto:
		approto -p $(ABSRC) $(MYSRC) > proto.h
